<?php
namespace Common\Behaviors;
use Think\Org\Util\Rbac;
use Think\Org\Util\RbacIFA;

class isLoginBehavior extends \Think\Behavior{
    
    public function run(&$param)
	{
		//return $this->_Check();
    }
	
	private function _Check()
	{
		$module = ltrim( __MODULE__ , "/");
		$checkModule = array('Admin','Console');
		if(!in_array($module, $checkModule)) {
			return true;
		}
		if($module === 'Admin') {
			if( session('adminID') ==  NULL ) {
				$redirectUrl = U("Home/Index/Index");
				return redirect($redirectUrl);
			}
			return true;
		}
		
		if($module === 'Console') {
			if( session('doctorID') ==  NULL ) {
				$redirectUrl = U("Home/Index/Index");
				return redirect($redirectUrl);
			}
			return true;
		}
		
	}	
}
